* gtk_recent_manager_add_item:
* @manager: a #GtkRecentManager
* @uri: a valid URI
- * @error: return location for a #GError, or %NULL
*
* Adds a new resource, pointed by @uri, into the recently used
* resources list.
*/
gboolean
gtk_recent_manager_add_item (GtkRecentManager *manager,
- const gchar *uri,
- GError **error)
+ const gchar *uri);
{
GtkRecentData *recent_data;
GError *add_error;
recent_data->is_private = FALSE;
add_error = NULL;
- retval = gtk_recent_manager_add_full (manager, uri, recent_data, &add_error);
+ retval = gtk_recent_manager_add_full (manager, uri, recent_data);
g_free (recent_data->mime_type);
g_free (recent_data->app_name);
g_slice_free (GtkRecentData, recent_data);
- if (!retval)
- {
- g_propagate_error (error, add_error);
-
- return FALSE;
- }
-
return retval;
}
* @manager: a #GtkRecentManager
* @uri: a valid URI
* @recent_data: metadata of the resource
- * @error: return location for a #GError, or %NULL
*
* Adds a new resource, pointed by @uri, into the recently used
* resources list, using the metadata specified inside the #GtkRecentData
if ((data->display_name) &&
(!g_utf8_validate (data->display_name, -1, NULL)))
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
- _("The display name of the recently used resource "
- "must be a valid UTF-8 encoded string."));
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but the display name is not a valid UTF-8 "
+ "encoded string",
+ uri);
return FALSE;
}
if ((data->description) &&
(!g_utf8_validate (data->description, -1, NULL)))
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
- _("The description of the recently used resource "
- "must be a valid UTF-8 encoded string."));
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but the description is not a valid UTF-8 "
+ "encoded string",
+ uri);
return FALSE;
}
if (!data->mime_type)
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_INVALID_MIME,
- _("You must specify the MIME type of the "
- "resource pointed by `%s'"),
- uri);
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but not MIME type was defined",
+ uri);
return FALSE;
}
if (!data->app_name)
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
- _("You must specify the name of the application "
- "that is registering the recently used resource "
- "pointed by `%s'"),
- uri);
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but no name of the application that is "
+ "registering it was defined"
+ uri);
return FALSE;
}
if (!data->app_exec)
{
- g_set_error (error, GTK_RECENT_MANAGER_ERROR,
- GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING,
- _("You must specify a command line to "
- "be used when launching the resource "
- "pointed by `%s'"),
- uri);
+ g_warning ("Attempting to add `%s' to the list of recently used "
+ "resources, but no command line for the application "
+ "that is registering it was defined",
+ uri);
return FALSE;
}
* @GTK_RECENT_MANAGER_ERROR_NOT_FOUND: the URI specified does not exists in
* the recently used resources list.
* @GTK_RECENT_MANAGER_ERROR_INVALID_URI: the URI specified is not valid.
- * @GTK_RECENT_MANAGER_ERROR_INVALID_MIME: the MIME type specified is not
- * valid.
* @GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING: the supplied string is not
* UTF-8 encoded.
* @GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED: no application has registered
{
GTK_RECENT_MANAGER_ERROR_NOT_FOUND,
GTK_RECENT_MANAGER_ERROR_INVALID_URI,
- GTK_RECENT_MANAGER_ERROR_INVALID_MIME,
GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING,
GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
- GTK_RECENT_MANAGER_ERROR_BAD_EXEC_STRING,
GTK_RECENT_MANAGER_ERROR_READ,
GTK_RECENT_MANAGER_ERROR_WRITE,
GTK_RECENT_MANAGER_ERROR_UNKNOWN
GdkScreen *screen);
gboolean gtk_recent_manager_add_item (GtkRecentManager *manager,
- const gchar *uri,
- GError **error);
+ const gchar *uri);
gboolean gtk_recent_manager_add_full (GtkRecentManager *manager,
const gchar *uri,
- const GtkRecentData *recent_data,
- GError **error);
+ const GtkRecentData *recent_data);
gboolean gtk_recent_manager_remove_item (GtkRecentManager *manager,
const gchar *uri,
GError **error);